//
//  City.m
//  ImGuider
//
//  Created by llt on 2017/4/14.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import "City.h"

@implementation City

+ (NSDictionary *)modelCustomPropertyMapper {
    
    return @{@"cid" : @"id"};
}

+ (NSDictionary *)modelContainerPropertyGenericClass {
    
    return @{@"weather" : [Weather class],@"views" : [Scenic class],@"customlines" : [LineModel class],@"tickets" : [TicketModel class], @"albums":[LineModel class],@"business":[MerchantModel class]};
}

- (NSArray *)tagsArray {
    
    return [self.tags componentsSeparatedByString:@","];
}

- (NSArray *)pictureArray {
    
    return [self.pictures componentsSeparatedByString:@","];
}

- (NSString *)smartName {
    
    NSString *name = @"";
    
    switch (AppManager.sharedManager.language) {
        case AppLanguageCNJan:
            
            name = _cname? _cname : _name;
            break;
        case AppLanguageCNFan:
        case AppLanguageCNFanXG:
            
            name = _fname;
            break;
        case AppLanguageJapanese:
            
            name = _jname;
            break;
        default:
            
            name = _ename;
            break;
    }
    
   
    if (name.length == 0) {
        name = _ename ? _ename : _city;
    }
    return name;
}

@end
